package com.neuedu.controller;

import com.neuedu.entity.User;
import com.neuedu.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @项目名称: springboot-Practice
 * @包 名: com.neuedu.controller
 * @作 者: Administrator
 * @创建时间: 2019-05-07 16:16
 * @描 述:
 */
@Controller
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = {"/","/userIndex"})
    public ModelAndView userIndex(){
//        List<User> list=userService.getUserList();
//        ModelMap map=new ModelMap();
//        map.addAttribute("title","jsp测试");
//        ModelAndView modeView=new  ModelAndView("userIndex",map);
        log.info("控制输出");
//        return modeView;
        ModelMap model = new ModelMap();
        model.addAttribute("name", "");
        return new ModelAndView("index", model);
    }
}
